/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package BoardGame;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Board</b></em>'.
 * <!-- end-user-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link BoardGame.Board#getFields <em>Fields</em>}</li>
 *   <li>{@link BoardGame.Board#getSelectedFigure <em>Selected Figure</em>}</li>
 *   <li>{@link BoardGame.Board#getWidth <em>Width</em>}</li>
 *   <li>{@link BoardGame.Board#getHeight <em>Height</em>}</li>
 * </ul>
 * </p>
 *
 * @see BoardGame.BoardGamePackage#getBoard()
 * @model
 * @generated
 */
public interface Board extends EObject {
	/**
	 * Returns the value of the '<em><b>Fields</b></em>' containment reference list.
	 * The list contents are of type {@link BoardGame.Field}.
	 * It is bidirectional and its opposite is '{@link BoardGame.Field#getBoard <em>Board</em>}'.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Fields</em>' containment reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Fields</em>' containment reference list.
	 * @see BoardGame.BoardGamePackage#getBoard_Fields()
	 * @see BoardGame.Field#getBoard
	 * @model opposite="board" containment="true"
	 * @generated
	 */
	EList<Field> getFields();

	/**
	 * Returns the value of the '<em><b>Selected Figure</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Selected Figure</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Selected Figure</em>' reference.
	 * @see #setSelectedFigure(Figure)
	 * @see BoardGame.BoardGamePackage#getBoard_SelectedFigure()
	 * @model
	 * @generated
	 */
	Figure getSelectedFigure();

	/**
	 * Sets the value of the '{@link BoardGame.Board#getSelectedFigure <em>Selected Figure</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Selected Figure</em>' reference.
	 * @see #getSelectedFigure()
	 * @generated
	 */
	void setSelectedFigure(Figure value);

	/**
	 * Returns the value of the '<em><b>Width</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Width</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Width</em>' attribute.
	 * @see #setWidth(int)
	 * @see BoardGame.BoardGamePackage#getBoard_Width()
	 * @model ordered="false"
	 * @generated
	 */
	int getWidth();

	/**
	 * Sets the value of the '{@link BoardGame.Board#getWidth <em>Width</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Width</em>' attribute.
	 * @see #getWidth()
	 * @generated
	 */
	void setWidth(int value);

	/**
	 * Returns the value of the '<em><b>Height</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Height</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Height</em>' attribute.
	 * @see #setHeight(int)
	 * @see BoardGame.BoardGamePackage#getBoard_Height()
	 * @model required="true" ordered="false"
	 * @generated
	 */
	int getHeight();

	/**
	 * Sets the value of the '{@link BoardGame.Board#getHeight <em>Height</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Height</em>' attribute.
	 * @see #getHeight()
	 * @generated
	 */
	void setHeight(int value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/BoardGame#//Board/initialize\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::initialize (w: EInt, h: EInt): void\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.2 \" name=\"move on to next column\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\">\r\n        <attributeAssignment attribute=\"http://www.moflon.org/BoardGame#//Board/width\">\r\n          <valueExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"this.width+1\" />\r\n        </attributeAssignment>\r\n      </objectVariable>\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.2 #//@ownedActivityEdge.3 \" incoming=\"#//@ownedActivityEdge.6 #//@ownedActivityEdge.5 #//@ownedActivityEdge.0 \" name=\"create field\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.1 #//@ownedActivityNode.2/@storyPattern/@linkVariable.3 #//@ownedActivityNode.2/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"LESS\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/height\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.calls.callExpressions:ParameterExpression\" parameter=\"http://www.moflon.org/BoardGame#//Board/initialize/h\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.4 #//@ownedActivityNode.2/@storyPattern/@linkVariable.2 \" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\">\r\n        <attributeAssignment attribute=\"http://www.moflon.org/BoardGame#//Field/x\">\r\n          <valueExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/width\" object=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.0\" />\r\n        </attributeAssignment>\r\n        <attributeAssignment attribute=\"http://www.moflon.org/BoardGame#//Field/y\">\r\n          <valueExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/height\" object=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.0\" />\r\n        </attributeAssignment>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.1 #//@ownedActivityNode.2/@storyPattern/@linkVariable.2 \" name=\"leftField\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/height\" object=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.0\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"width-1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"OPTIONAL\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"NeighbourWest\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.3 #//@ownedActivityNode.2/@storyPattern/@linkVariable.4 \" name=\"upField\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/width\" object=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.0\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"height-1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"OPTIONAL\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"NeighbourNorth\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.5\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.4 #//@ownedActivityEdge.5 \" incoming=\"#//@ownedActivityEdge.1 \" name=\"if width is in range, reset height\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"LESS\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGame#//Board/width\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.calls.callExpressions:ParameterExpression\" parameter=\"http://www.moflon.org/BoardGame#//Board/initialize/w\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <attributeAssignment attribute=\"http://www.moflon.org/BoardGame#//Board/height\">\r\n          <valueExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt\" value=\"0\" />\r\n        </attributeAssignment>\r\n      </objectVariable>\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.4 \" name=\"\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.6 \" incoming=\"#//@ownedActivityEdge.3 \" name=\"move on to next row\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\">\r\n        <attributeAssignment attribute=\"http://www.moflon.org/BoardGame#//Board/height\">\r\n          <valueExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"this.height+1\" />\r\n        </attributeAssignment>\r\n      </objectVariable>\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.5\" />\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Iterator fujaba__IterThisToLeftField = null;\n      Field leftField = null;\n      Iterator fujaba__IterThisToUpField = null;\n      Field upField = null;\n      Field field = null;\n\n      do\n      {\n      while (true)\n      {\n         // story pattern create field\n         try \n         {\n            fujaba__Success = false; \n\n            // attribute condition\n            JavaSDM.ensure ( this.getHeight () < h );\n\n            // iterate to-many link fields from this to leftField\n            fujaba__Success = false;\n\n            fujaba__IterThisToLeftField = this.getFields().iterator ();\n\n            while ( !(fujaba__Success) && fujaba__IterThisToLeftField.hasNext () )\n            {\n               try\n               {\n                  leftField = (Field) fujaba__IterThisToLeftField.next ();\n\n                  // check optional\n                  if (leftField != null)\n                  {\n                     // attribute condition\n                     JavaSDM.ensure ( leftField.getX () == width-1 );\n\n                     // attribute condition\n                     JavaSDM.ensure ( leftField.getY () == this.getHeight() );\n\n                  }\n                  fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n            }\n            if (!fujaba__Success)\n            {\n               fujaba__Success = true;\n               leftField = null;\n            }\n            // iterate to-many link fields from this to upField\n            fujaba__Success = false;\n\n            fujaba__IterThisToUpField = this.getFields().iterator ();\n\n            while ( !(fujaba__Success) && fujaba__IterThisToUpField.hasNext () )\n            {\n               try\n               {\n                  upField = (Field) fujaba__IterThisToUpField.next ();\n\n                  // check optional\n                  if (upField != null)\n                  {\n                     // attribute condition\n                     JavaSDM.ensure ( upField.getX () == this.getWidth() );\n\n                     // attribute condition\n                     JavaSDM.ensure ( upField.getY () == height-1 );\n\n                  }\n                  fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n            }\n            if (!fujaba__Success)\n            {\n               fujaba__Success = true;\n               upField = null;\n            }\n            // create object field\n            field = BoardGameFactory.eINSTANCE.createField();\n            // assign attribute field\n            field.setX (this.getWidth());\n            // assign attribute field\n            field.setY (this.getHeight());\n            // create link\n            field.setBoard( this);\n\n            // check optional\n            if (leftField != null)\n            {\n               // create link\n               leftField.setNeighbourEast( field);\n\n            }// check optional\n            if (upField != null)\n            {\n               // create link\n               upField.setNeighbourSouth( field);\n\n            }   fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n         if (!fujaba__Success)\n         {\n            break;\n         }\n         // story pattern move on to next row\n         try \n         {\n            fujaba__Success = false; \n\n            // assign attribute this\n            this.setHeight (this.height+1);\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n      }\n      // story pattern move on to next column\n      try \n      {\n         fujaba__Success = false; \n\n         // assign attribute this\n         this.setWidth (this.width+1);\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      // story pattern if width is in range, reset height\n      try \n      {\n         fujaba__Success = false; \n\n         // attribute condition\n         JavaSDM.ensure ( this.getWidth () < w );\n\n         // assign attribute this\n         this.setHeight (0);\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n\n      }\n      while (fujaba__Success);\n      return ;'"
	 * @generated
	 */
	void initialize(int w, int h);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/BoardGame#//Board/pressed\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::pressed (field: Field): void\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 #//@ownedActivityEdge.2 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"isSelected\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"selFigure\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"DESTROY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.0\" name=\"selectedFigure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StatementNode\" outgoing=\"#//@ownedActivityEdge.3 \" incoming=\"#//@ownedActivityEdge.2 \" name=\"delegateMoveToFigure\">\r\n    <statementExpression xsi:type=\"SDMLanguage.calls.callExpressions:MethodCallExpression\" callee=\"http://www.moflon.org/BoardGame#//Figure/moveTo\">\r\n      <ownedParameterBindings parameter=\"http://www.moflon.org/BoardGame#//Figure/moveTo/field\">\r\n        <valueExpression xsi:type=\"SDMLanguage.expressions:TextualExpression\" expressionText=\"field\" />\r\n      </ownedParameterBindings>\r\n      <target xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" />\r\n    </statementExpression>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.3 #//@ownedActivityEdge.4 \" name=\"\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.4 \" incoming=\"#//@ownedActivityEdge.1 \" name=\"noFigureSelected\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.1 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 #//@ownedActivityNode.4/@storyPattern/@linkVariable.1 \" name=\"toBeSelFigure\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.2\" name=\"selectedFigure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" name=\"figure\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.4\" />\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Figure selFigure = null;\n      Figure toBeSelFigure = null;\n\n      // story pattern isSelected\n      try \n      {\n         fujaba__Success = false; \n\n         // bind object\n         selFigure = this.getSelectedFigure ();\n\n         // check object selFigure is really bound\n         JavaSDM.ensure ( selFigure != null );\n\n\n         // destroy link\n         org.moflon.util.eMoflonEMFUtil.removeOppositeReference(this,selFigure,\"selectedFigure\");\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      if (fujaba__Success)\n      {\n         selFigure.moveTo(field);\n\n      }\n      else\n      {\n         // story pattern noFigureSelected\n         try \n         {\n            fujaba__Success = false; \n\n            // check object field is really bound\n            JavaSDM.ensure ( field != null );\n            // bind object\n            toBeSelFigure = field.getFigure ();\n\n            // check object toBeSelFigure is really bound\n            JavaSDM.ensure ( toBeSelFigure != null );\n\n\n            // create link\n            this.setSelectedFigure( toBeSelFigure);\n\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n      }\n      return ;'"
	 * @generated
	 */
	void pressed(Field field);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model kind="operation"
	 *        annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/BoardGame#//Board/getUpperLeftField\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::getUpperLeftField (): Field\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"determine field with neither northern nor western neighbour\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.1 #//@ownedActivityNode.1/@storyPattern/@linkVariable.2 \" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <objectVariable bindingSemantics=\"NEGATIVE\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.1 \" name=\"north\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.2\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" name=\"NeighbourNorth\" />\r\n      <objectVariable bindingSemantics=\"NEGATIVE\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.2 \" name=\"west\" type=\"ecore:EClass http://www.moflon.org/BoardGame#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.3\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" name=\"NeighbourWest\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.1 \" name=\"field\">\r\n    <returnValue xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" />\r\n  </ownedActivityNode>\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Field north = null;\n      Field west = null;\n      Iterator fujaba__IterThisToField = null;\n      Field field = null;\n\n      // story pattern determine field with neither northern nor western neighbour\n      try \n      {\n         fujaba__Success = false; \n\n         // iterate to-many link fields from this to field\n         fujaba__Success = false;\n\n         fujaba__IterThisToField = this.getFields().iterator ();\n\n         while ( !(fujaba__Success) && fujaba__IterThisToField.hasNext () )\n         {\n            try\n            {\n               field = (Field) fujaba__IterThisToField.next ();\n\n               // check object field is really bound\n               JavaSDM.ensure ( field != null );\n               // check negative bindings\n               try\n               {\n                  fujaba__Success = false;\n\n                  // bind object\n                  north = field.getNeighbourNorth ();\n\n                  // check object north is really bound\n                  JavaSDM.ensure ( north != null );\n\n                  // check isomorphic binding between objects north and field\n                  JavaSDM.ensure ( !north.equals (field) );\n\n\n\n                  fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n\n               fujaba__Success = !(fujaba__Success);\n\n               JavaSDM.ensure ( fujaba__Success );\n\n               // check negative bindings\n               try\n               {\n                  fujaba__Success = false;\n\n                  // bind object\n                  west = field.getNeighbourWest ();\n\n                  // check object west is really bound\n                  JavaSDM.ensure ( west != null );\n\n                  // check isomorphic binding between objects west and field\n                  JavaSDM.ensure ( !west.equals (field) );\n\n\n\n                  fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n\n               fujaba__Success = !(fujaba__Success);\n\n               JavaSDM.ensure ( fujaba__Success );\n\n\n               fujaba__Success = true;\n            }\n            catch ( JavaSDMException fujaba__InternalException )\n            {\n               fujaba__Success = false;\n            }\n         }\n         JavaSDM.ensure (fujaba__Success);\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      return field;'"
	 * @generated
	 */
	Field getUpperLeftField();

} // Board
